package com.icetec.iceintel.netrequest;import java.net.DatagramPacket;import java.net.InetAddress;import java.net.MulticastSocket;/** * Created by zhhyyspy on 2014/11/13. * 寻找网关的广播发送器 */public class SearchGatewayBroadCastSender {    public void send() {        try {            InetAddress ip = InetAddress.getByName(InstrutionConstant.BroadcastIp);            DatagramPacket packet = new DatagramPacket(                    InstruionMaker.getSearchGatewayKey(),                    InstruionMaker.getSearchGatewayKey().length,                    ip,                    InstrutionConstant.BroadcastSendPort);            MulticastSocket ms = new MulticastSocket(InstrutionConstant.BroadcastSendPort);            ms.send(packet);            ms.close();        } catch (Exception e) {            e.printStackTrace();        }    }}